package com.wp;

import org.mybatis.spring.annotation.MapperScan;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan(basePackages = "com.wp.dao")
public class RedisSpringBoot02Application {

    public static void main(String[] args) {
        SpringApplication.run(RedisSpringBoot02Application.class, args);
    }
    @Bean
    public RedissonClient redisson(){
        // 1. Create config object
        Config config = new Config();
        config.useSingleServer()
                // use "rediss://" for SSL connection
                .setAddress("redis://192.168.111.128:6379");
        RedissonClient redisson = Redisson.create(config);
        return redisson;
    }
}
